** calculate summary stats for annual place-level data

set trace off
set more 1 
capture log close
clear
clear matrix
set mem 5g
set matsize 800
set linesize 200
version 9

log using placeann_stats.log, replace

use placeann , clear

drop nplace
egen mark = tag(newid)
gen temp = 1 if hu80~=. & areal90~=. & sfus~=.
egen cdata = mean(temp), by(newid)
drop temp
egen nplace = count(newid) if mark==1, by(cbsa)
egen nplace2 = count(newid) if mark==1 & cdata==1, by(cbsa)
egen markc = tag(cbsa) if mark==1 & cdata==1
sum nplace2 if markc==1, det

sum hu80 areal90 avgtime80 if mark==1 & cdata==1, det

sum sfus if cdata==1, det


quietly log off
quietly log close
set more 0


